<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // 创建book
        function Book(name,price,author,press) {
            this.name = name;
            this.price = price;
            this.author = author;
            this.press = press;
        }
        Book.prototype.life = function () {
            console.log('我的大学生活，作者为奥特曼...');
        }
        function BookX(name,price,author,press) {
            var obj = new Object();
            obj.name = name;
            obj.price = price;
            obj.author = author;
            obj.press = press;
            return obj;
        }
        var bk = new Book('我的大学生活','55.00元','奥特曼','北京大学出版社');
        Book('我的大学生活','55.00元','奥特曼','北京大学出版社');
    </script>
</body>
</html>